﻿<%@ page title="" language="C#" masterpagefile="~/MasterPages/MasterPage.master" autoeventwireup="true" inherits="Pages_Public_ProjectDetails, BtcHousing" stylesheettheme="ServerControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server">  
    <style type="text/css">
        .DownloadBrochure
        {
            width:200px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) 0px 0px no-repeat;
        	cursor:pointer;
        	margin-right:10px;
        }
        .DownloadBrochure:hover
        {
            width:200px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) 0px -44px no-repeat;
        	cursor:pointer;
        }
        .SendToFriend
        {
            width:162px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) 0px -88px no-repeat;
        	cursor:pointer;
        	margin-right:10px;
        }
        .SendToFriend:hover
        {
            width:162px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) 0px -132px no-repeat;
        	cursor:pointer;
        	margin-right:10px;
        }
        .AddToFavorite
        {
            width:200px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) -162px -88px no-repeat;
        	cursor:pointer;
        	margin-right:10px;
        }
        .AddToFavorite:hover
        {
            width:200px;
        	height:44px;
        	background:url(/Images/SpriteSpecialButtons.png) -162px -132px no-repeat;
        	cursor:pointer;
        	margin-right:10px;
        }
    </style>     
    
    <%--Google Map Code Start--%>
    <script type="text/javascript">
        var latitude = '<%=_Latitude %>';
        var longitude = '<%=_Longitude %>';
        function ShowLocationInGoogleMap() {            
            LoadGoogleMapScript();
        }
        function LoadGoogleMap() {
            var myLatlng = new google.maps.LatLng(latitude, longitude);
            var myOptions = {
                zoom: 15,
                panControl: true,
                center: myLatlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            }
            var map = new google.maps.Map(document.getElementById("divGoogleMapContainer"), myOptions);
            var marker = new google.maps.Marker({
                position: myLatlng,
                map: map,
                title: "<%= h4Heading.InnerHtml %>"
            });
            HideProgressAnimation();
        }

        function LoadGoogleMapScript() {
            var scriptTag = $("body script[src='http://maps.google.com/maps/api/js?sensor=false&callback=LoadGoogleMap']").length;            
            ShowCenteredProgressAnimation();
            ShowModalPopup('divModalGoogleMapContainer', '', '', false);            
            if (scriptTag == 0) {
                var script = document.createElement("script");
                script.type = "text/javascript";
                script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=LoadGoogleMap";
                document.body.appendChild(script);
            }
            else
                LoadGoogleMap(); 
        }
        //window.onload = LoadScript;
    </script>
    <script language="javascript" type="text/javascript">
        var _ProjectID = <%= _ProjectID %>;        
        function SendToFriend(projectID) {
            $('#divSuccessMessage').hide();
            ShowModalPopup('divSendToFriend', '', '', true);
        }
        function SendEmailToFriend() {
            if (Page_ClientValidate('SendToFriend')) {
                ShowProgressAnimation('btnSend', 0, -20);
                PageMethods.SendEmailToFriend(_ProjectID, $('#<%=txtFriendName.ClientID %>').val(), $('#<%=txtFrientEmail.ClientID %>').val(), $('#<%=txtMessage.ClientID %>').val(), SendEmail_Success, OnAjax_Error, OnAjax_TimeOut);
            }
        }
        function SendEmail_Success(hasSent) {
            HideProgressAnimation();
            if(hasSent)
            {
                $('#divSuccessMessage').fadeIn('slow', null);
                $('#<%=txtFriendName.ClientID %>').val('');
                $('#<%=txtFrientEmail.ClientID %>').val('');
                $('#<%=txtMessage.ClientID %>').val('');
            }
            else
                alert('Unable to send the email.');
        }
        function AddToFavorite(){            
            $('#imgAddToFavoriteLoading').show();
            $('#divAddToFavoriteMessage').hide();
            ShowModalPopup('divAddToFavorite', '', '', true);
            PageMethods.AddToFavorite(_ProjectID, AddToFavorite_Success, OnAjax_Error, OnAjax_TimeOut);
        }
        function AddToFavorite_Success(result)
        {
            $('#imgAddToFavoriteLoading').hide();
            $('#divAddToFavoriteMessage').show();
        }
        $(document).ready(function () {
            $('.ContentBox').hover(function () {
                $(this).find('.ContentHeading').addClass('ContentHeadingHover');
            },
            function () {
                $(this).find('.ContentHeading').removeClass('ContentHeadingHover');
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">
    <div id="divMessage" class="ErrorMessageBox" runat="server" visible="false" style="display:block; margin-bottom:15px;"></div>
    <asp:Panel ID="pnlFormContainer" runat="server">
        <h4 id="h4Heading" runat="server"></h4>
        <div id="divProjectFiles" runat="server"> 
            <asp:Literal ID="ltrProjectFiles" runat="server"></asp:Literal>             
            <div class="clearboth"></div>
        </div>

        <%--<div class="SectionGroupBoxHeading">General Information</div> 
        <div class="SectionGroupBox">
            <asp:Literal ID="ltrGeneralInformation" runat="server"></asp:Literal>            
        </div>--%>
                
        <div class="ContentBoxContainer">
            <div class="ContentBox">
                <div class="ContentHeading">General Information</div>
                <asp:Literal ID="ltrGeneralInformation" runat="server"></asp:Literal>
            </div>
        </div>

        <%--<div class="SectionGroupBoxHeading">Location</div> 
        <div class="SectionGroupBox">
            <asp:Literal ID="ltrLocation" runat="server"></asp:Literal>            
        </div>--%>
        <div class="ContentBoxContainer">
            <div class="ContentBox">
                <div class="ContentHeading">Location</div>
                <asp:Literal ID="ltrLocation" runat="server"></asp:Literal>
            </div>
        </div>

        <%--<div class="SectionGroupBoxHeading">Specification</div> 
        <div class="SectionGroupBox">
            <asp:Literal ID="ltrSpecification" runat="server"></asp:Literal>            
        </div>--%>
        <div class="ContentBoxContainer">
            <div class="ContentBox">
                <div class="ContentHeading">Specification</div>
                <asp:Literal ID="ltrSpecification" runat="server"></asp:Literal>
            </div>
        </div>

        <%--<div class="SectionGroupBoxHeading">Pricing</div> 
        <div class="SectionGroupBox">
            <asp:Literal ID="ltrPricing" runat="server"></asp:Literal>            
        </div>--%>
        <div class="ContentBoxContainer">
            <div class="ContentBox">
                <div class="ContentHeading">Pricing</div>
                <asp:Literal ID="ltrPricing" runat="server"></asp:Literal>
            </div>
        </div>

        <%--<div class="SectionGroupBoxHeading">Contact Person</div> 
        <div class="SectionGroupBox">
            <asp:Literal ID="ltrContactPerson" runat="server"></asp:Literal>            
        </div>--%>
        <div class="ContentBoxContainer">
            <div class="ContentBox">
                <div class="ContentHeading">Contact Person</div>
                <asp:Literal ID="ltrContactPerson" runat="server"></asp:Literal>
            </div>
        </div>


        <div style="margin-top:10px;">
            <div id="divDownloadBrocheure" runat="server" visible="false" class="floatleft">
                <a id="anchorBrocheure" href="javascript:void(0);" runat="server" target="_blank">
                    <img src="/Images/Blank.gif" class="DownloadBrochure" />
                </a>            
            </div>
            <div id="divSendToFriend" runat="server" visible="false" class="SendToFriend floatleft" onclick="SendToFriend();"></div>
            <div id="divAddToFavorite" runat="server" visible="false" class="AddToFavorite floatleft" onclick="AddToFavorite();"></div>
            <div class="clearboth"></div>
            <%--<div>
                <asp:HyperLink ID="hplBrocheure" runat="server" Visible="false" Target="_blank">Download Brocheure</asp:HyperLink>
            </div>            
            <div>
                <asp:HyperLink ID="hplSendToFriend" NavigateUrl="javascript:void(0);" runat="server" Visible="false">Send to Friend</asp:HyperLink>
            </div>
            <div>
                <asp:HyperLink ID="hplAddToFavorite" NavigateUrl="javascript:void(0);" runat="server" Visible="false">Add to Favorite</asp:HyperLink>
            </div>--%>
        </div>



        <%--<div class="ContentBoxContainer">
            <div id="divGoogleMapContainer" style="height:400px;">
                
            </div>
        </div> --%>      
        <%--Google Map Code End--%>
    </asp:Panel>

    <%--Modal Popup For Google Map Start--%>
    <div id="divModalGoogleMapContainer" class="PopupContainer" style="display: none; width:700px; height:auto;">        
        <div class="PopupBody" style="padding:5px;">            
            <div id="divGoogleMapContainer" style="height:450px;"><%=_GoogleMapMessage%></div>
        </div>
        <div class="PopupButtonContainer">                        
            <input type="button" value="Close" class="ButtonCommon" onclick="HideModalPopup();" />            
        </div>
    </div>
    <%--Modal Popup for Google Map End--%>
    
    <%--Modal Popup Section Starts From Here--%>
    <div id="divModalConfirm" class="PopupContainer" style="display: none; width:800px; height:500px;">        
        <div class="PopupBody" style="padding:5px;">            
            <div style="overflow:auto; height:450px;">
                <img id="imgImageViewer" src="/Images/Loading.gif" />
            </div>
        </div>
        <div class="PopupButtonContainer">                        
            <input type="button" value="Close" class="ButtonCommon" onclick="CloseImageViewer();" />            
        </div>
    </div>
    <%--Modal Popup Section Ends Here--%>

    <%--Send to Friend Modal Popup Section--%>
    <div id="divSendToFriend" class="PopupContainer" style="display: none; width:500px; height:auto;">        
        <div class="PopupHeaderMiddle">
            Send to Friend<br />
            <span style="font-weight:normal;"><asp:Literal ID="ltrProjectTitle" runat="server"></asp:Literal></span>
        </div> 
        <div class="PopupBody" style="padding:5px; height:180px;">
            <div id="divSuccessMessage" class="MessageBox" style="display:none;">Your friend has been notified about this project.</div>            
            <table cellpadding="3" cellspacing="0" style="width:100%;">
                <colgroup>
                    <col style="width:21%;" />
                    <col />
                </colgroup>                
                <tr>
                    <td>Friend's Name<span class="requiredMark">*</span></td>
                    <td>
                        <asp:TextBox ID="txtFriendName" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="txtFriendName"
                            Display="Dynamic" SetFocusOnError="true"
                            ErrorMessage="Please enter your friend's Name."
                            ValidationGroup="SendToFriend">
                        </asp:RequiredFieldValidator>                        
                    </td>
                </tr>
                <tr>
                    <td>Friend's Email<span class="requiredMark">*</span></td>
                    <td>
                        <asp:TextBox ID="txtFrientEmail" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvFrientEmail" runat="server"
                            ControlToValidate="txtFrientEmail"
                            Display="Dynamic" SetFocusOnError="true"
                            ErrorMessage="Please enter your friend's email."
                            ValidationGroup="SendToFriend">
                        </asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="txtFrientEmail" Display="Dynamic" SetFocusOnError="true"
                            ErrorMessage="Please enter a valid Email address."
                            ValidationGroup="SendToFriend">
                        </asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td>Your Message<span class="requiredMark">*</span></td>
                    <td>
                        <asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" MaxLength="2000"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="txtMessage"
                            Display="Dynamic" SetFocusOnError="true"
                            ErrorMessage="Please enter message."
                            ValidationGroup="SendToFriend">
                        </asp:RequiredFieldValidator>
                    </td>
                </tr>                
            </table>
        </div>
        <div class="PopupButtonContainer"> 
            <input id="btnSend" type="button" value="Send to Friend" class="ButtonCommon" onclick="SendEmailToFriend();" />
            <input type="button" value="Close" class="ButtonInActive" onclick="HideModalPopup();" />            
        </div>
    </div>
    <%--Send To Frient Modal Popup Section End--%>

    <%--Send to Friend Modal Popup Section--%>
    <div id="divAddToFavorite" class="PopupContainer" style="display: none; width:500px; height:auto;">        
        <div class="PopupHeaderMiddle">Add to Favorite</div> 
        <div class="PopupBody" style="padding:5px; height:50px;">
            <div id="divAddToFavoriteMessage" class="MessageBox" style="display:none;">Project Saved to your Favorites List.</div>
            <img id="imgAddToFavoriteLoading" src="/Images/Loading.gif" />            
        </div>
        <div class="PopupButtonContainer">             
            <input type="button" value="Close" class="ButtonCommon" onclick="HideModalPopup();" />            
        </div>
    </div>
    <%--Send To Frient Modal Popup Section End--%>
</asp:Content>

